<template>
  <index-cmpt :models="models"></index-cmpt>
</template>

<script>
import IndexCmpt from '@/bank/views/business/28/normal/IndexCmpt'
import { mapGetters } from 'vuex'
export default {
  components: {
    IndexCmpt,
  },
  props: {},
  data() {
    return {}
  },
  computed: {
    ...mapGetters(['taskCountNormal']),
    productId() {
      return this.$route.query.id || ''
    },
    models() {
      return [
        {
          title: '受理推荐',
          subTitle: '待办',
          subCount: this.taskCountNormal.todo_claim_total || 0,
          url: '/res_index/mission/normal/recom',
        },
        {
          title: '审批登记',
          subTitle: '待办',
          subCount: this.taskCountNormal.todo_approval_register_total || 0,
          url: '/res_index/mission/normal/invest',
        },
        {
          title: '放款登记',
          subTitle: '待办',
          subCount: this.taskCountNormal.todo_loan_register_total || 0,
          url: '/res_index/mission/normal/register',
        },
        {
          title: '贷后管理',
          subTitle: '待办',
          subCount: this.taskCountNormal.todo_exp_total || 0,
          url: '/res_index/mission/normal/postloan',
        },
      ]
    },
  },
  watch: {
    productId: {
      handler: function () {
        this.getCount()
      },
      immediate: true,
    },
  },
  created() {},
  mounted() {},
  methods: {
    getCount() {
      this.$store.dispatch('getTaskCountNormal', this.productId)
    },
  },
}
</script>

<style lang="scss" scoped></style>
